<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>layout</title>
		
		<jsp:include page="../common/common.jsp"></jsp:include>
		
		<!-- http://localhost:8080/easyui1607/demo/menuDyn.jsp -->
		<script type="text/javascript">
		$(function(){
			$('#mytree').tree({
				url:'${pageContext.request.contextPath}/central/menu/init.do',
				lines:true,
				
				//当点击左边的菜单栏的时候触发这个方法
				onClick: function (node) {
                	console.log(node);
                    // 增加1个新的页签   scottTabs右边页面内容div的id 
                	if ($('#scottTabs').tabs('exists', node.text)){
                		$('#scottTabs').tabs('select', node.text);
                	}else{
                		$('#scottTabs').tabs('add', {
                        	//页签的标题
                            title:  node.text,
                            //点击菜单栏之后连接到哪里去
                            href: node.attributes.url,
                            //页签是否可以关闭
                            closable: true,

                        });  
                	}
                }//end of onClick
				
				
			});
		});
		</script>
	</head>
	<body>
		<!-- 此处显示左侧的菜单栏  如果有任何疑问，请联系开发者 huanghoulin 13926583118    -->
		<ul id="mytree">   
		</ul>  
	</body>
	
	
	
</html>